package com.exam.service.impl;

import com.exam.pojo.domain.FeedBack;
import com.exam.service.IFeedBackService;
import lombok.RequiredArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
@RequiredArgsConstructor
public class FeedBackServiceImpl implements IFeedBackService {

    private final MongoTemplate mongoTemplate;
    @Override
    public void addFeedBack(FeedBack feedBack) {
        feedBack.setId(new ObjectId());
        feedBack.setCreateTime(LocalDateTime.now());
        mongoTemplate.save(feedBack);
    }
}
